'''
Created on Jan 2013

@author: dexen
'''

import time
import random

import dexen

from individual import Individual
                    
class DevTask(dexen.BaseSlaveTask):
    def __init__(self):
        pass
    
    def __execute__(self, master_state, inds):
        for ind in inds:
            print "id = ", inds[0]._get_id(), type(inds[0]._get_id())
            g = ind.genotype
            p = [[],[],[],[],[],[],[],[],[],[]]
            p_str = ""
            for row in range(10):
                p_str += "\n"
                for col in range(10):
                    p[row].append(g[(row * 10) + col])
                    p_str += (str(g[(row * 10) + col]) + " ")
            ind.phenotype = p
            ind.archive_data("phenotype.txt", p_str)
        return inds